package org.nicocube.airain.domain.client.gamedate;

public class IncrementalGameDate extends AbstractGameDate {

	private static final long serialVersionUID = 1L;

	private AbstractGameDate date;

	protected IncrementalGameDate() {}

	public IncrementalGameDate(AbstractGameDate date) {
		this.date = date;
	}

	@Override
	public long getTimestamp() {
		return date.getTimestamp();
	}

	@Override
	protected void setTimestamp(long timestamp) {
		date.setTimestamp(timestamp);
	}

	public IncrementalGameDate incHour() {
		return incHour(1);
	}

	public IncrementalGameDate incHour(int h) {
		setTimestamp(getTimestamp() + (h * game_hours_seconds));
		return this;
	}

	public IncrementalGameDate incDay() {
		return incDay(1);
	}

	public IncrementalGameDate incDay(int d) {
		setTimestamp(getTimestamp() + (d * game_day_seconds));
		return this;
	}

	public IncrementalGameDate incMoon() {
		return incMoon(1);
	}

	public IncrementalGameDate incMoon(int m) {
		setTimestamp(getTimestamp() + (m * game_moon_seconds));
		return this;
	}

	public IncrementalGameDate incYear() {
		return incYear(1);
	}

	public IncrementalGameDate incYear(int y) {
		setTimestamp(getTimestamp() + (y * game_year_seconds));
		return this;
	}

	public AbstractGameDate getDate() {
		return date;
	}

	@Override
	public int getHours() {
		return date.getHours();
	}

	@Override
	public int getMoonDays() {
		return date.getMoonDays();
	}

	@Override
	public Season getSeason() {
		return date.getSeason();
	}

	@Override
	public long getTotalDays() {
		return date.getTotalDays();
	}

	@Override
	public long getTotalMoons() {
		return date.getTotalMoons();
	}

	@Override
	public int getYearDays() {
		return date.getYearDays();
	}

	@Override
	public int getYearMoons() {
		return date.getYearMoons();
	}

	@Override
	public long getYears() {
		return date.getYears();
	}

	@Override
	public String toString() {
		return date.toString();
	}

	@Override
	public int compareTo(GameDate o) {
		return date.compareTo(o);
	}

}
